package com.demo;

import android.os.Bundle;
import android.app.Activity;
//import android.util.Log;
import android.view.Menu;
//import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Button;
import android.content.Intent;
import android.view.View;



public class MainActivity extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		
		//RelativeLayout r = new RelativeLayout(this);
		//setContentView(r);
		//Button b = new Button(this);
		//b.setText("Return EventActivity");
		//r.addView(b);
		//Log.d("DEBUG", "message");
		
		TextView t = (TextView) findViewById(R.id.viewtext1);
		t.setText(new news().getContent());
		
		
		Button b = (Button) findViewById(R.id.button1);
		b.setOnClickListener(new Button.OnClickListener() {
			public void onClick(View v)
			{
				Intent i = new Intent();
				i.setClass(MainActivity.this, EventActivity.class);
				startActivity(i);
				MainActivity.this.finish();
			}
		});
		
		Button plane_btn = (Button) findViewById(R.id.plane);
		plane_btn.setOnClickListener(new Button.OnClickListener() {
			public void onClick(View v)
			{
				Intent i = new Intent();
				i.setClass(MainActivity.this, PlaneActivity.class);
				startActivity(i);
				MainActivity.this.finish();
			}
		});
		
		Button layout_btn = (Button) findViewById(R.id.demolayout);
		layout_btn.setOnClickListener(new Button.OnClickListener() {
			public void onClick(View v)
			{
				Intent i = new Intent();
				i.setClass(MainActivity.this, DemoLayout.class);
				startActivity(i);
				MainActivity.this.finish();
			}
		});
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}

}
